package com.ccz.demo.design.proxy.demo1.dynamic;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @ClassName DynamicProxy
 * @Author caihaoyun
 * @Date 2020/4/13
 * @Version V1.0
 **/
public class DynamicProxyLawyer implements InvocationHandler {

    private Object target;

    public DynamicProxyLawyer(Object obj) {
        this.target = obj;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("案件进展" + method.getName());
        Object result = method.invoke(target, args);
        return result;
    }
}
